home *** CD-ROM | disk | FTP | other *** search
- // Borland C++ Builder
- // Copyright (c) 1995, 1999 by Borland International
- // All rights reserved
-
- // (DO NOT EDIT: machine generated header) 'kpZipObj.pas' rev: 5.00
-
- #ifndef kpZipObjHPP
- #define kpZipObjHPP
-
- #pragma delphiheader begin
- #pragma option push -w-
- #pragma option push -Vx
- #include <kpCntn.hpp> // Pascal unit
- #include <Classes.hpp> // Pascal unit
- #include <SysUtils.hpp> // Pascal unit
- #include <Windows.hpp> // Pascal unit
- #include <SysInit.hpp> // Pascal unit
- #include <System.hpp> // Pascal unit
-
- //-- user supplied -----------------------------------------------------------
-
- namespace Kpzipobj
- {
- //-- type declarations -------------------------------------------------------
- typedef Word cpltype[31];
-
- typedef Word cpdtype[30];
-
- typedef unsigned U_LONG;
-
- typedef int LongInt;
-
- typedef double Comp;
-
- typedef __int64 BIGINT;
-
- typedef char CharArray[2147483647];
-
- typedef char *CharArrayPtr;
-
- typedef Byte ByteArray[2147483647];
-
- typedef Byte *ByteArrayPtr;
-
- typedef int IntegerArray[32767];
-
- typedef int *IntegerArrayPtr;
-
- typedef int *IntPtr;
-
- typedef Byte *BYTEPTR;
-
- typedef Word *WORDPTR;
-
- typedef short short_int;
-
- #pragma pack(push, 1)
- struct shrinktype
- {
- short Prefix_of[8195];
- Byte Suffix_of[8195];
- Byte Stack[8195];
- } ;
- #pragma pack(pop)
-
- #pragma pack(push, 1)
- struct DataDescriptorType
- {
- int Sig;
- int crc32;
- int compressed_size;
- int uncompressed_size;
- } ;
- #pragma pack(pop)
-
- typedef Byte f_array[256][64];
-
- typedef Byte *f_arrayPtr;
-
- struct huft;
- typedef huft *huftptr;
-
- typedef huftptr *huftptrptr;
-
- struct kpZipObj__1
- {
-
- union
- {
- struct
- {
- huft *t;
-
- };
- struct
- {
- Word n;
-
- };
-
- };
- } ;
-
- #pragma pack(push, 1)
- struct huft
- {
- Byte e;
- Byte b;
- kpZipObj__1 v;
- } ;
- #pragma pack(pop)
-
- typedef huft huftarray[1002];
-
- typedef huft *huftarrayptr;
-
- typedef Word llarraytype[316];
-
- typedef Word *llarrayptr;
-
- typedef Byte slidearray[32768];
-
- typedef Byte *slidearrayptr;
-
- #pragma pack(push, 1)
- struct work
- {
-
- union
- {
- struct
- {
- Byte Slide[32768];
-
- };
- struct
- {
- shrinktype shrink;
-
- };
-
- };
- } ;
- #pragma pack(pop)
-
- typedef AnsiString *pString;
-
- typedef pString *ppString;
-
- typedef AnsiString TZipFilename;
-
- typedef AnsiString TZipPathname;
-
- typedef void __fastcall (__closure *TNewDiskEvent)(System::TObject* Sender, Classes::TStream* &S);
-
- #pragma pack(push, 1)
- struct SignatureType
- {
-
- union
- {
- struct
- {
- Word ID1;
- Word ID2;
-
- };
- struct
- {
- int Sig;
-
- };
-
- };
- } ;
- #pragma pack(pop)
-
- #pragma pack(push, 1)
- struct local_file_header
- {
- SignatureType Signature;
- Word version_needed_to_extract;
- Word general_purpose_bit_flag;
- Word compression_method;
- unsigned last_mod_file_date_time;
- unsigned crc32;
- int compressed_size;
- int uncompressed_size;
- Word filename_length;
- Word extra_field_length;
- } ;
- #pragma pack(pop)
-
- typedef local_file_header *localPtr;
-
- #pragma pack(push, 1)
- struct central_file_header
- {
- SignatureType Signature;
- Word version_made_by;
- Word version_needed_to_extract;
- Word general_purpose_bit_flag;
- Word compression_method;
- unsigned last_mod_file_date_time;
- unsigned crc32;
- int compressed_size;
- int uncompressed_size;
- Word filename_length;
- Word extra_field_length;
- Word file_comment_length;
- Word disk_number_start;
- Word internal_file_attributes;
- unsigned external_file_attributes;
- int relative_offset;
- } ;
- #pragma pack(pop)
-
- typedef central_file_header *centralPtr;
-
- class DELPHICLASS TZipHeaderInfo;
- class PASCALIMPLEMENTATION TZipHeaderInfo : public Classes::TPersistent
- {
- typedef Classes::TPersistent inherited;
-
- private:
- bool DR;
- Word Fversion_made_by;
- Word Fversion_needed_to_extract;
- Word Fgeneral_purpose_bit_flag;
- Word Fcompression_method;
- unsigned Flast_mod_file_date_time;
- unsigned Fcrc32;
- int Fcompressed_size;
- int Funcompressed_size;
- Word Ffilename_length;
- Word FCextra_field_length;
- Word FLextra_field_length;
- Word Ffile_comment_length;
- Word Fdisk_number_start;
- Word Finternal_file_attributes;
- unsigned Fexternal_file_attributes;
- int Frelative_offset;
- int Fcentral_offset;
- AnsiString Ffilename;
- AnsiString Fdirectory;
- char *Ffilecomment;
- bool FMatchFlag;
- Byte FFileIsOK;
- bool FSelected;
-
- protected:
- bool __fastcall GetHasComment(void);
- bool __fastcall GetIsEncrypted(void);
- bool __fastcall GetHasDescriptor(void);
- char * __fastcall Getfilecomment(Classes::TStream* S);
- int __fastcall GetLocalSize(void);
- int __fastcall GetCentralSize(void);
- void __fastcall Setfilename(AnsiString FName);
- void __fastcall Setdirectory(AnsiString Directory);
- void __fastcall SetFileComment(char * FComment);
-
- public:
- __fastcall TZipHeaderInfo(void);
- __fastcall TZipHeaderInfo(centralPtr crec, AnsiString FName);
- __fastcall TZipHeaderInfo(localPtr lrec, AnsiString FName);
- __fastcall virtual ~TZipHeaderInfo(void);
- virtual void __fastcall Assign(Classes::TPersistent* Source);
- virtual void __fastcall AssignTo(Classes::TPersistent* Dest);
- void __fastcall SetFromCentral(centralPtr crec, AnsiString FName);
- void __fastcall SetFromLocal(localPtr lrec, AnsiString FName);
- void __fastcall Clear(void);
- void __fastcall SaveCentralToStream(Classes::TStream* S);
- void __fastcall SaveLocalToStream(Classes::TStream* S);
- bool __fastcall ReadCentralFromStream(Classes::TStream* &S, TNewDiskEvent NewDiskEvent);
- bool __fastcall ReadLocalFromStream(Classes::TStream* S);
- void __fastcall SetDateTime(System::TDateTime DateTime);
- void __fastcall SetNewFileComment(AnsiString NewComment);
- __property Word version_made_by = {read=Fversion_made_by, write=Fversion_made_by, nodefault};
- __property Word version_needed_to_extract = {read=Fversion_needed_to_extract, write=Fversion_needed_to_extract
- , nodefault};
- __property Word general_purpose_bit_flag = {read=Fgeneral_purpose_bit_flag, write=Fgeneral_purpose_bit_flag
- , nodefault};
- __property Word compression_method = {read=Fcompression_method, write=Fcompression_method, nodefault
- };
- __property unsigned last_mod_file_date_time = {read=Flast_mod_file_date_time, write=Flast_mod_file_date_time
- , nodefault};
- __property unsigned crc32 = {read=Fcrc32, write=Fcrc32, nodefault};
- __property int compressed_size = {read=Fcompressed_size, write=Fcompressed_size, nodefault};
- __property int uncompressed_size = {read=Funcompressed_size, write=Funcompressed_size, nodefault};
- __property Word filename_length = {read=Ffilename_length, write=Ffilename_length, nodefault};
- __property Word Cextra_field_length = {read=FCextra_field_length, write=FCextra_field_length, nodefault
- };
- __property Word Lextra_field_length = {read=FLextra_field_length, write=FLextra_field_length, nodefault
- };
- __property Word file_comment_length = {read=Ffile_comment_length, write=Ffile_comment_length, nodefault
- };
- __property Word disk_number_start = {read=Fdisk_number_start, write=Fdisk_number_start, nodefault};
-
- __property Word internal_file_attributes = {read=Finternal_file_attributes, write=Finternal_file_attributes
- , nodefault};
- __property unsigned external_file_attributes = {read=Fexternal_file_attributes, write=Fexternal_file_attributes
- , nodefault};
- __property int relative_offset = {read=Frelative_offset, write=Frelative_offset, nodefault};
- __property int central_offset = {read=Fcentral_offset, write=Fcentral_offset, nodefault};
- __property AnsiString filename = {read=Ffilename, write=Setfilename};
- __property AnsiString directory = {read=Fdirectory, write=Setdirectory};
- __property bool MatchFlag = {read=FMatchFlag, write=FMatchFlag, nodefault};
- __property bool HasComment = {read=GetHasComment, nodefault};
- __property bool Encrypted = {read=GetIsEncrypted, nodefault};
- __property bool HasDescriptor = {read=GetHasDescriptor, nodefault};
- __property char * filecomment = {read=Ffilecomment, write=SetFileComment};
- __property int LocalSize = {read=GetLocalSize, nodefault};
- __property int CentralSize = {read=GetCentralSize, nodefault};
- __property Byte FileIsOK = {read=FFileIsOK, write=FFileIsOK, nodefault};
- __property bool Selected = {read=FSelected, write=FSelected, nodefault};
- };
-
-
- #pragma pack(push, 1)
- struct end_of_central
- {
- int ID;
- Word this_disk;
- Word start_central_disk;
- Word num_entries_this_disk;
- Word num_entries;
- int size_central;
- int offset_central;
- Word zip_comment_length;
- } ;
- #pragma pack(pop)
-
- typedef end_of_central *end_of_centralPtr;
-
- class DELPHICLASS TEndCentral;
- class PASCALIMPLEMENTATION TEndCentral : public Classes::TPersistent
- {
- typedef Classes::TPersistent inherited;
-
- private:
- #pragma pack(push, 1)
- end_of_central Fecrec;
- #pragma pack(pop)
-
- char *FZipComment;
- int FZipCommentPos;
- bool FModified;
-
- protected:
- bool __fastcall GetZipHasComment(void);
- char * __fastcall GetZipComment(Classes::TStream* S);
- int __fastcall GetEndCentralSize(void);
- __property end_of_central ecrec = {read=Fecrec, write=Fecrec};
-
- public:
- __fastcall TEndCentral(void);
- __fastcall virtual ~TEndCentral(void);
- void __fastcall SetNewZipComment(AnsiString NewComment);
- virtual void __fastcall Assign(Classes::TPersistent* Source);
- virtual void __fastcall AssignTo(Classes::TPersistent* Dest);
- void __fastcall SetFromEndCentral(end_of_centralPtr crec);
- void __fastcall Clear(void);
- void __fastcall SaveToStream(Classes::TStream* S);
- bool __fastcall ReadFromStream(Classes::TStream* S);
- __property int ID = {read=Fecrec.ID, write=Fecrec.ID, nodefault};
- __property Word this_disk = {read=Fecrec.this_disk, write=Fecrec.this_disk, nodefault};
- __property Word start_central_disk = {read=Fecrec.start_central_disk, write=Fecrec.start_central_disk
- , nodefault};
- __property Word num_entries_this_disk = {read=Fecrec.num_entries_this_disk, write=Fecrec.num_entries_this_disk
- , nodefault};
- __property Word num_entries = {read=Fecrec.num_entries, write=Fecrec.num_entries, nodefault};
- __property int size_central = {read=Fecrec.size_central, write=Fecrec.size_central, nodefault};
- __property int offset_central = {read=Fecrec.offset_central, write=Fecrec.offset_central, nodefault
- };
- __property Word zip_comment_length = {read=Fecrec.zip_comment_length, write=Fecrec.zip_comment_length
- , nodefault};
- __property bool ZipHasComment = {read=GetZipHasComment, nodefault};
- __property int ZipCommentPos = {read=FZipCommentPos, write=FZipCommentPos, nodefault};
- __property char * ZipComment = {read=FZipComment, write=FZipComment};
- __property bool Modified = {read=FModified, write=FModified, default=0};
- __property int EndCentralSize = {read=GetEndCentralSize, nodefault};
- };
-
-
- #pragma option push -b-
- enum TZipSortMode { ByName, ByFileName, ByDirectoryName, ByDate, ByCompressedSize, ByUnCompressedSize,
- ByRate, ByNone };
- #pragma option pop
-
- class DELPHICLASS TSortedZip;
- class PASCALIMPLEMENTATION TSortedZip : public Kpcntn::TSortedObjectList
- {
- typedef Kpcntn::TSortedObjectList inherited;
-
- private:
- TZipSortMode FSortMode;
- System::TDateTime FFilesDate;
-
- public:
- __fastcall TSortedZip(Classes::TDuplicates WithDuplicates);
- virtual int __fastcall Compare(void * Key1, void * Key2);
- __property TZipSortMode SortMode = {read=FSortMode, write=FSortMode, default=7};
- __property System::TDateTime filesdate = {read=FFilesDate, write=FFilesDate};
- public:
- #pragma option push -w-inl
- /* TObjectList.CreateWithOptions */ inline __fastcall TSortedZip(bool DestroyObjects, int InitialCapacity
- ) : Kpcntn::TSortedObjectList(DestroyObjects, InitialCapacity) { }
- #pragma option pop
- #pragma option push -w-inl
- /* TObjectList.Destroy */ inline __fastcall virtual ~TSortedZip(void) { }
- #pragma option pop
- #pragma option push -w-inl
- /* TObjectList.CreateFromStream */ inline __fastcall TSortedZip(const AnsiString FileName) : Kpcntn::TSortedObjectList(
- FileName) { }
- #pragma option pop
-
- };
-
-
- //-- var, const, procedure ---------------------------------------------------
- static const Word PATH_LEN = 0x104;
- static const Word FILENAME_LEN = 0x100;
- static const Word MAX_USHORT = 0xffff;
- static const Word MAX_SHORT = 0x7fff;
- static const Shortint icUNDEFINED = 0x0;
- static const Shortint icFILEOK = 0x1;
- static const Shortint icFILEBAD = 0x2;
- static const Shortint STORED = 0x0;
- static const Shortint SHRUNK = 0x1;
- static const Shortint REDUCED1 = 0x2;
- static const Shortint REDUCED2 = 0x3;
- static const Shortint REDUCED3 = 0x4;
- static const Shortint REDUCED4 = 0x5;
- static const Shortint IMPLODED = 0x6;
- static const Shortint TOKENIZED = 0x7;
- static const Shortint DEFLATED = 0x8;
- extern PACKAGE System::SmallString<4> comp_method[9];
- extern PACKAGE Word mask_bits[17];
- extern PACKAGE Word border[19];
- extern PACKAGE Word cplens[31];
- extern PACKAGE Word cplext[31];
- extern PACKAGE Word cpdist[30];
- extern PACKAGE Word cpdext[30];
- extern PACKAGE Word cplen2[64];
- extern PACKAGE Word cplen3[64];
- extern PACKAGE Word extra[64];
- extern PACKAGE Word cpdist4[64];
- extern PACKAGE Word cpdist8[64];
- extern PACKAGE Word L_table[5];
- extern PACKAGE Word D_shift[5];
- extern PACKAGE Word D_mask[5];
- extern PACKAGE Word B_table[256];
- extern PACKAGE unsigned CRC_32_TAB[256];
- static const int DEF_CENTSIG = 0x2014b50;
- static const int DEF_LOCSIG = 0x4034b50;
- static const int DEF_ENDSIG = 0x6054b50;
- static const Word INBUFSIZ = 0x8000;
- static const Word OUTBUFSIZ = 0x8000;
- static const Shortint BMAX = 0x10;
- static const Word N_MAX = 0x120;
- static const Shortint MAX_BITS = 0xd;
- static const Word HSIZE = 0x2000;
- static const Word WSIZE = 0x8000;
- static const Word ZWSIZE = 0x8000;
- static const Shortint UNKNOWN = 0x2;
- static const Shortint BINARY = 0x0;
- static const Shortint ASCII = 0x1;
- static const Shortint MIN_MATCH = 0x3;
- static const Word MAX_MATCH = 0x102;
- static const Shortint MAX_ZBITS = 0xf;
- static const Shortint LENGTH_CODES = 0x1d;
- static const Word LITERALS = 0x100;
- static const Word L_CODES = 0x11e;
- static const Shortint D_CODES = 0x1e;
- static const Shortint HASH_BITS = 0xf;
- static const Word MIN_LOOKAHEAD = 0x106;
- static const Word MAX_DIST = 0x7efa;
- static const Word HASH_SIZE = 0x8000;
- static const Word HASH_MASK = 0x7fff;
- static const Word WMASK = 0x7fff;
- static const Shortint FAST = 0x4;
- static const Shortint SLOW = 0x2;
- static const Word TOO_FAR = 0x1000;
- static const Shortint H_SHIFT = 0x5;
- static const Shortint EQUAL = 0x0;
- static const Shortint EOFile = 0xffffffff;
- static const Shortint MAX_BL_BITS = 0x7;
- static const Word END_BLOCK = 0x100;
- static const Shortint BL_CODES = 0x13;
- static const Shortint STORED_BLOCK = 0x0;
- static const Shortint STATIC_TREES = 0x1;
- static const Shortint DYN_TREES = 0x2;
- static const Word LIT_BUFSIZE = 0x8000;
- static const Word DIST_BUFSIZE = 0x8000;
- static const Shortint REP_3_6 = 0x10;
- static const Shortint REPZ_3_10 = 0x11;
- static const Shortint REPZ_11_138 = 0x12;
- static const Word HEAP_SIZE = 0x23d;
- static const Shortint SMALLEST = 0x1;
- static const Shortint STORE = 0x0;
- static const Shortint DEFLATEIT = 0x8;
- static const Shortint Buf_size = 0x10;
- static const Shortint INIT_BITS = 0x9;
- static const Word FIRST_ENT = 0x101;
- static const Word CLEAR = 0x100;
- static const Byte DLE = 0x90;
- extern PACKAGE int CENTSIG;
- extern PACKAGE int LOCSIG;
- extern PACKAGE int ENDSIG;
- extern PACKAGE Byte LOC4;
- extern PACKAGE Byte LOC3;
- extern PACKAGE Byte LOC2;
- extern PACKAGE Byte LOC1;
- extern PACKAGE Byte END4;
- extern PACKAGE bool __fastcall DRun(void);
- extern PACKAGE void __fastcall setZipSignatures(int csig, int lsig, int esig);
-
- } /* namespace Kpzipobj */
- #if !defined(NO_IMPLICIT_NAMESPACE_USE)
- using namespace Kpzipobj;
- #endif
- #pragma option pop // -w-
- #pragma option pop // -Vx
-
- #pragma delphiheader end.
- //-- end unit ----------------------------------------------------------------
- #endif // kpZipObj
-